<% if (folders.length) { %>
<ul class="folder-list">
<% } %>

    <% folders.forEach(function(folder){ %>
    <% var isActive = parents.includes(folder.id) %>
    <li class="folder<%= isActive ? ' active' : ''%>">
      <% var iconClass = folder.isTrashCan ? 'trash' : 'folder' %>
      <i class="fa foldericon fa-<%= iconClass %>" aria-hidden="true"></i>
      <% if (parents.includes(folder.id)) { %>
        <%= folder.prettyName %>
      <% } else { %>
        <a href="<%= formatUrl('/') %>?id=<%= locals.id %>&dest=<%= folder.id %>"><%= folder.prettyName %></a>
      <% } %>
      <%- include('./folderList', {folders: folder.children, id, parents, formatUrl}) %>
    </li>
    <% }) %>

<% if (folders.length) { %>
</ul>
<% } %>
